<?php
	include_once("king_head.php");
?>

<?php
	include_once("ClsSebent/config.php");

	if("$action"=="Save" && $_SESSION['SITE_ID'] != ""){

		$sql="UPDATE site_home SET company_name='$company_name', company_name_img='$company_name_img', company_name_img_alt='$company_name_img_alt', slogan='$slogan', contact_info='$contact_info', copyright='$copyright', page_bg_image='$page_bg_image', page_bg_color='$page_bg_color', page_text_color='$page_text_color', page_link_text_color='$page_link_text_color', page_link_visited_color='$page_link_visited_color', page_link_rollover_color='$page_link_rollover_color', menu_link_text_color='$menu_link_text_color', menu_link_visited_color='$menu_link_visited_color', menu_link_rollover_color='$menu_link_rollover_color', meta_title='$meta_title', meta_description='$meta_description', meta_keywords='$meta_keywords' WHERE id=$_SESSION['SITE_ID']";
		//echo $sql;
		mysql_query($sql);
	}
	$sql="SELECT * FROM site_home WHERE id=$_SESSION['SITE_ID']";

	$result = mysql_query($sql);
	if($row=mysql_fetch_array($result)){
		$company_name=$row["company_name"];
		$company_name_img=$row["company_name_img"];
		$company_name_img_alt=$row["company_name_img_alt"];
		$slogan=$row["slogan"];
		$contact_info=$row["contact_info"];
		$copyright=$row["copyright"];
		$page_bg_image=$row["page_bg_image"];
		$page_bg_color=$row["page_bg_color"];
		$page_text_color=$row["page_text_color"];
		$page_link_text_color=$row["page_link_text_color"];
		$page_link_visited_color=$row["page_link_visited_color"];
		$page_link_rollover_color=$row["page_link_rollover_color"];
		$menu_link_text_color=$row["menu_link_text_color"];
		$menu_link_visited_color=$row["menu_link_visited_color"];
		$menu_link_rollover_color=$row["menu_link_rollover_color"];
		$meta_title=$row["meta_title"];
		$meta_description=$row["meta_description"];
		$meta_keywords=$row["meta_keywords"];
	}
?>

<CENTER>
<H2> Skin Control Panel</H2>
<form><input type=hidden name=site_id value="<?php echo $_SESSION['SITE_ID']; ?>">
<TABLE>
<TR><td>Company Name</td><td><input name=company_name value="<?php echo $company_name; ?>" size=40></td></tr>
<tr><td>Company name image </td><td><input type=file name=company_name_img value="<?php echo $company_name_img; ?>" size=40></td></tr>
<tr><td>Company name image alt </td><td><input name=company_name_img_alt value="<?php echo $company_name_img_alt; ?>" size=40></td></tr>
<tr><td>Slogan</td><td><input name=slogan value="<?php echo $slogan; ?>" size=40></td></tr>
<tr><td>Contact info</td><td><textarea name=contact_info rows=5 cols=40><?php echo $contact_info; ?></textarea size=40></td></tr>
<tr><td>Copyright Message</td><td><input name=copyright value="<?php echo $copyright; ?>" size=40></td></tr>
<tr><td>Page background image </td><td><input type=file name=page_bg_image value="<?php echo $page_bg_image; ?>" size=40></td></tr>
<tr><td>Page background color</td><td>
	<?php
	$color_sql="SELECT * FROM colors ORDER BY color";
	$color_result = mysql_query($color_sql);
	?>
	<select name=page_bg_color>	
	<?php showColorOption($page_bg_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Page text color  </td><td>
	<select name=page_text_color>	
	<?php showColorOption($page_text_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Page link text color </td><td>
	<select name=page_link_text_color>	
	<?php echo $page_link_text_color;
	showColorOption($page_link_text_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Page link visited color </td><td>
	<select name=page_link_visited_color>	
	<?php showColorOption($page_link_visited_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Page link rollover color </td><td>
	<select name=page_link_rollover_color>	
	<?php showColorOption($page_link_rollover_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Menu link text color </td><td>
	<select name=menu_link_text_color>	
	<?php showColorOption($menu_link_text_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Menu link visited color </td><td>
	<select name=menu_link_visited_color>	
	<?php showColorOption($menu_link_visited_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Menu link rollover color </td><td>
	<select name=menu_link_rollover_color>	
	<?php showColorOption($menu_link_rollover_color,$color_result); ?>
	</select>
</td></tr>
<tr><td>Meta keywords </td><td><input name=meta_keywords value="<?php echo $meta_keywords; ?>" size=40></td></tr>
<tr><td>Meta description </td><td><input name=meta_description value="<?php echo $meta_description; ?>" size=40></td></tr>
<tr><td>Meta title </td><td><input name=meta_title value="<?php echo $meta_title; ?>" size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit name=action value=Save></TD>
</TR>
</TABLE></form>
</CENTER>

<?php
	include_once("king_foot.php");
?>